package com.xy.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Cacheable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

/*
 * 库存盘点
 */
@SuppressWarnings("serial")
@Entity
@Table
@Cacheable
public class StockCheck extends Identified implements Serializable {
	@Column(nullable = false)
	private int count;// 数量
	@Column(nullable = false)
	private Date dateTime;// 盘点时间
	private String remark;// 备注
	// 对应管理员表
	@ManyToOne(targetEntity = Admin.class)
	@JoinColumn(name = "Admin_Id", referencedColumnName = "id")
	@Cascade(CascadeType.SAVE_UPDATE)
	private Admin admin;
	// 对应货架表
	@ManyToOne(targetEntity = Cell.class)
	@JoinColumn(name = "Cell_Id", referencedColumnName = "id")
	@Cascade(CascadeType.SAVE_UPDATE)
	private Cell cell;

	@ManyToOne(targetEntity = TextBook.class)
	@JoinColumn(name = "TextBook_Id", referencedColumnName = "id")
	@Cascade(CascadeType.SAVE_UPDATE)
	private TextBook textBook;

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public Date getDateTime() {
		return dateTime;
	}

	public void setDateTime(Date dateTime) {
		this.dateTime = dateTime;
	}

	public String getRemark() {
		return remark;
	}

	public void setRemark(String remark) {
		this.remark = remark;
	}

	public Admin getAdmin() {
		return admin;
	}

	public void setAdmin(Admin admin) {
		this.admin = admin;
	}

	public Cell getCell() {
		return cell;
	}

	public void setCell(Cell cell) {
		this.cell = cell;
	}

	public TextBook getTextBook() {
		return textBook;
	}

	public void setTextBook(TextBook textBook) {
		this.textBook = textBook;
	}

	public StockCheck() {
		super();
		// TODO Auto-generated constructor stub
	}

}
